import request from '@/utils/request'

// 获取各区县月均薪资环比
export function getSalarybyDistrict(query) {
  return request({
    url: '/maintainerSalary/salaryRatio',
    method: 'get',
    params: query
  })
}

// 获取一线维护人员薪酬列表
export function listSalary(query) {
  return request({
    url: '/salary/getSalary',
    method: 'get',
    params: query
  })
}
// 获取all salary
export function allSalary(query) {
  return request({
    url: '/salary/getAll',
    method: 'get',
    params: query
  })
}

// 获取存量维护家宽salary
export function homeBroadBand(query) {
  return request({
    url: '/salary/homeBroadband',
    method: 'get',
    params: query
  })
}

// 获取存量维护企宽salary
export function bizBroadband(query) {
  return request({
    url: '/salary/bizBroadband',
    method: 'get',
    params: query
  })
}

// 获取新装按次家宽salary
export function newHome(query) {
  return request({
    url: '/salary/newHome',
    method: 'get',
    params: query
  })
}

// 获取新装按次企宽salary
export function newBiz(query) {
  return request({
    url: '/salary/newBiz',
    method: 'get',
    params: query
  })
}

// 获取上门整治
export function rectify(query) {
  return request({
    url: '/salary/rectify',
    method: 'get',
    params: query
  })
}

// 获取服务奖罚
export function serviceRewardPenalty(query) {
  return request({
    url: '/salary/serviceRewardPenalty',
    method: 'get',
    params: query
  })
}

// 获取金银铜
export function medalLevel(query) {
  return request({
    url: '/salary/medalLevel',
    method: 'get',
    params: query
  })
}

// 获取激励包分配
export function incentivePackage(query) {
  return request({
    url: '/salary/incentivePackage',
    method: 'get',
    params: query
  })
}

// 获取平均薪酬统计
export function aveSalary(query) {
  return request({
    url: '/maintainerSalary/avgSalaryByMonth',
    method: 'get',
    params: query
  })
}

// 获取薪酬环比率
export function MomSalary(query) {
  return request({
    url: '/maintainerSalary/getMoM',
    method: 'get',
    params: query
  })
}

// 上传文件
export function uploadFile(params) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: params,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 导入文件
export function importData(params) {
  return request({
    url: '/salary/import',
    method: 'get',
    params
  })
}
export function delIncome(ids) {
  return request({
    url: `/salary/${ids.join(',')}`,
    method: 'delete'
  })
}
